<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0" xmlns:date="*** Processing dates ***"
	exclude-result-prefixes="date">
	<xsl:import href="dates.xsl" />
	
	<xsl:output method="html" encoding="UTF-8" indent="yes"></xsl:output>
	<xsl:param name="liste-par-nom" select="false()" />


	<xsl:template match="/">
		<html>
			<head>
			<style type="text/css"> @import "style.css"; </style>
				<title>Mangas Space</title>
				
			</head>
			
			
			<div id="content">
			<div id="contenu" class="center" align="center"> 
			<body>
				<br />
				<h1 align="center">Bienvenue dans Le monde des animes</h1>

				<xsl:choose>
					<xsl:when test="$liste-par-nom">
						
						<div align="left">
							<ul id="tabMenu">
								<li><xsl:apply-templates mode="toc" select="//nom">
									<xsl:sort select="." />
								</xsl:apply-templates>
							</li></ul></div>
							
						
					</xsl:when>
					<xsl:otherwise>
						<div align="left">
							<ul>
								<xsl:apply-templates mode="toc" select="//nom">
									<xsl:sort select="../date_sortie" />
								</xsl:apply-templates>
							</ul>
							
						</div>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:apply-templates />

			</body></div></div>
			<div class="footer roundedB"></div>
	
		
		</html>
	</xsl:template>

	<xsl:template match="nom" mode="toc">
		<li>
			<a href="#{generate-id()}">
				<xsl:value-of select="." />
			</a>
		</li>
	</xsl:template>

	<xsl:template match="Animes">
		<br />
		<br />
		<br />
		<div align="center">
			<table colspan="3" width="100%">
				<thead>
					<tr>
						<td class="encadreTd" align="center">Nom</td>
						<td class="encadreTd" align="center">Details</td>
						<td class="encadreTd" align="center" width="35%">Production</td>
					</tr>
				</thead>
				<tbody>
					<xsl:apply-templates />
				</tbody>
			</table>
		</div>
	</xsl:template>

	<xsl:template match="Anime">
		<tr>
			<td class="encadre" align="center">
				<h3>
					<a name="{generate-id(nom)}">
						<xsl:value-of select="nom" />
					</a>
				</h3>
				<img  class="img" width="200" height="300" src="img/{@img}" />
			</td>
			<td class="encadre" align="center">

				<b>Date de sortie : </b>
				<xsl:call-template name="date:format">
					<xsl:with-param name="date" select="annee_sortie" />
				</xsl:call-template>
				<br />
				<b>Episodes : </b>
				<xsl:value-of select="episodes" />
				<br />
				<b>Genre : </b>
				<xsl:value-of select="genre" />
				<br />
				<b>Origine : </b>
				<xsl:value-of select="origine" />
				<br />
			</td>
			<td class="encadre" align="center" width="200px">
				<xsl:apply-templates select="Productions" />
			</td>
		</tr>
		<tr>
			<td colspan="3">
			</td>
		</tr>
	</xsl:template>

	<xsl:template match="Productions">
		<xsl:apply-templates />
	</xsl:template>

	<xsl:template match="Production">
		<b>Nom Company : </b>
			<xsl:value-of select="nom_production" />
			<xsl:text> </xsl:text><br/>
		<b>Date de production : </b>
				<xsl:call-template name="date:format">
					<xsl:with-param name="date" select="date_production" />
				</xsl:call-template>
		<br />
		<b>Prix de production :</b>
		<xsl:value-of select="prix_production" />
		<br />
		<b>Prix d'achat :</b>
		<xsl:value-of select="cout_achat" />
		<br />
		
	</xsl:template>


</xsl:stylesheet>